package com.gps.cms.managed.bean;

import java.io.Serializable;
import java.util.ArrayList;
import java.util.List;

import javax.faces.bean.ManagedBean;
import javax.faces.bean.ManagedProperty;
import javax.faces.bean.RequestScoped;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import com.gps.cms.model.Jobs;
import com.gps.cms.service.IJobsService;

@ManagedBean(name="jobsMB")
@RequestScoped
public class JobsManagedBean implements Serializable {

	private final Logger _log = LoggerFactory.getLogger(this.getClass().getName());
	private static final long serialVersionUID = 1L;
	private static final String SUCCESS = "success";
	
	@ManagedProperty(value="#{JobsService}")
	IJobsService jobService;
	List<Jobs> listJob;
	public IJobsService getJobService() {
		return jobService;
	}
	public void setJobService(IJobsService jobService) {
		this.jobService = jobService;
	}
	public List<Jobs> getListJob() {
		return listJob;
	}
	public void setListJob(List<Jobs> listJob) {
		this.listJob = listJob;
	}
	
	
	public List<Jobs> getJobsList() {
		listJob = new ArrayList<Jobs>();
		listJob.addAll(getJobService().getJobss());
		   _log.info(SUCCESS);
		return listJob;
	}
	
}
